<?php
namespace app\admin\controller;
use app\admin\model\Apply as ApplyModel;

//申请管理类
class Apply extends Base
{
    /**
     * 申请列表
     */
    public function applyLst()
    {
        $list = ApplyModel::order('a_create_time DESC')->paginate(10);

        $info['code']    = '200';
        $info['data']    = $list;
        echo displayJson($info);die;
    }

    /**
     * 删除申请
     */
    public function applyDel()
    {
        $id  = input('id');

        $del = db('apply',[],false)->where('a_id',$id)->delete();

        if ($del) {
            $info['code']    = '200';
            $info['message'] = '删除成功';
            echo displayJson($info);die;
        } else {
            $info['code']    = '400';
            $info['message'] = '删除失败';
            echo displayJson($info);die;
        }
    }
}